package com.lanou3g.farmdoctor.fragment;

import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.lanou3g.farmdoctor.R;
import com.lanou3g.farmdoctor.base.BaseFragment;


/**
 * 本类由: Risky 创建于: 15/11/24.
 */
public class FindFragment extends BaseFragment implements View.OnClickListener {

    private TextView titleTv;
    private RelativeLayout countryRe, applyProRe, nearShopRe, createShopRe, judgeRe, friendRe, shopRe;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_find, null);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        initView(getView());
    }

    private void initView(View v) {
        titleTv = (TextView) v.findViewById(R.id.tv_middle);
        titleTv.setText(R.string.find);

        countryRe = (RelativeLayout) v.findViewById(R.id.find_countryside);
        applyProRe = (RelativeLayout) v.findViewById(R.id.find_apply_professor);
        nearShopRe = (RelativeLayout) v.findViewById(R.id.find_near_shop);
        createShopRe = (RelativeLayout) v.findViewById(R.id.find_create_shop);
        judgeRe = (RelativeLayout) v.findViewById(R.id.find_judge_true);
        friendRe = (RelativeLayout) v.findViewById(R.id.find_welcome_friend);
        shopRe = (RelativeLayout) v.findViewById(R.id.find_shopping);

        countryRe.setOnClickListener(this);
        applyProRe.setOnClickListener(this);
        nearShopRe.setOnClickListener(this);
        createShopRe.setOnClickListener(this);
        judgeRe.setOnClickListener(this);
        friendRe.setOnClickListener(this);
        shopRe.setOnClickListener(this);
    }

    /**
     * 监听事件
     */
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.find_countryside:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.find_apply_professor:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.find_near_shop:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.find_create_shop:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.find_judge_true:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.find_welcome_friend:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.find_shopping:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}


